<template>
  <el-button
    type="primary"
    plain
    size="mini"
    style="margin-bottom: 5px"
    :disabled="item.disabled||false"
    @click="handleClick"
  >{{ item.name }}
  </el-button>
</template>

<script>

import base from '../mixin/base'

export default {
  name: 'HeyTableElButtonAdd',
  components: {},
  mixins: [base],
  data() {
    return {}
  },
  computed: {},
  created() {
    const operateParam__ = {
      isValid: false
    }
    this.setParam({ ...this.operateParam_, ...operateParam__, ...this.operateParam, ...this.item.operateParam }, true)
  },
  mounted() {

  },
  methods: {
    genParam() {
      const { item, operateParam_ } = this
      const { param = {}} = operateParam_
      const urlParam = {}
      urlParam.pageType = item.type
      Object.keys(param).forEach(key => {
        const paramValue = param[key]
        if (paramValue && !key.includes('grp')) {
          urlParam[key] = paramValue
          return true
        }
      })
      return urlParam
    },
    operate() {
      if (!this.validate()) {
        return
      }
      this.openPage()
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
